Crate spacetimedb_table
source ·Expand description
The spacetimedb_table
crate provides a Table
implementation
and various ways to interact with a table.
Modules§
- Provides the function [
read_row_from_page(ser, page, fixed_offset, ty)
] which serializesvalue = page.get_row_data(fixed_offset, fixed_row_size)
typed atty
and associated var len objects invalue
into the serializerser
. - Provides the functions [
write_row_to_pages(pages, blob_store, ty, val)
] and [write_row_to_page(page, blob_store, visitor, ty, val)
] which writeval: ProductValue
typed atty
topage
andpages
respectively. - This module implements a fast path for serializing certain types from BFLATN to BSATN.
- Provides the interface
BlobStore
that tables use to talk to a blob store engine for large var-len objects. - BTree indexes with specialized key types.
- Provides the function [
eq_row_in_page(page_a, page_b, offset_a, offset_b, ty)
] which, forvalue_a/b = page_a/b.get_row_data(offset_a/b, fixed_row_size)
typed atty
, comparesvalue_a
andvalue_b
for equality. - Provides primitive types and definitions around bytes, row hashes, (page) sizes, offsets, and indices.
- Defines
Layout
, which encompasses the fixed size and alignment of an object, e.g., a row, or a column, or some other sub-division of a row. - Provides a
Page
abstraction that stores rows and an associated header necessary for the page to work. Consult the documentation of this type for a list of operations and a description of how page work. - Provides
PointerMap
that deals with the association of aRowHash
to aRowPointer
through operationsinsert
anddelete
. - Provides a trait
ReadColumn
for extracting a single column from acrate::table::RowRef
. This is desirable as frequently, e.g. when evaluating filtered queries, we are interested in only a single column (or a small set of columns), and would like to avoid the allocation required by aProductValue
. - Provides the function [
hash_row_in_page(hasher, page, fixed_offset, ty)
] which hashesvalue = page.get_row_data(fixed_offset, fixed_row_size)
typed atty
and associated var len objects invalue
intohasher
. - A
VarLenMembers
visitor for [AlgebraicType
], supporting any non-recursiveAlgebraicType
, including sums and products.
Macros§
- Asserts that
$ty
is aligned at$align
bytes instatic_assert_align($ty, $align)
. - Asserts that
$ty
is$size
bytes instatic_assert_size($ty, $size)
.